#ifndef MOUSEDIALOG_H
#define MOUSEDIALOG_H

#include <QDialog>
#include <QMouseEvent>

QT_BEGIN_NAMESPACE
namespace Ui { class MouseDialog; }
QT_END_NAMESPACE

class MouseDialog : public QDialog
{
    Q_OBJECT

public:
    MouseDialog(QWidget *parent = nullptr);
    ~MouseDialog();

private:
    //当鼠标按下时被执行
    void mousePressEvent (QMouseEvent *);
    //当鼠标抬起时被执行
    void mouseReleaseEvent(QMouseEvent *);
    //鼠标移动时被执行
    void mouseMoveEvent (QMouseEvent *);

private:
    Ui::MouseDialog *ui;
    bool m_dDrag; //标记是否为鼠标左键选中
    QPoint m_ptPos; //记录鼠标点击和label的相对位置
};
#endif // MOUSEDIALOG_H
